<template>
	<view>
		<view class="top">
			<u-navbar title="我的积分" back-icon-color="#fff" title-color="#fff" :background="{background:'transparent'}" :border-bottom="false"></u-navbar>
			
			<view class="padding-xl flex-row justify-between main">
				<view class="left">
					<view class="text">
						可用积分
					</view>
					<view class="money">
						{{finance.score}}
					</view>
				</view>
				<view class="flex-col align-center justify-around">
					<!-- <view class="btn btn1" hover-class="on">
						赚积分
					</view> -->
					<!-- <view class="btn btn2" hover-class="on">
						去兑换
					</view> -->
				</view>
			</view>
		</view>
		
		<view class="margin-top-xl">
			<u-cell-group>
				<u-cell-item title="交易记录" @click="$goto('/pages/mine/records?type=score')">
					<image src="../../static/images/data2.png" style="width: 30rpx;margin-right: 16rpx;" mode="widthFix" slot="icon"></image>
				</u-cell-item>
			</u-cell-group>
			<u-cell-group>
				<u-cell-item title="积分商城" @click="$goto('/pages/mall/index', 'tab')">
					<image src="../../static/images/data3.png" style="width: 30rpx;margin-right: 16rpx;" mode="widthFix" slot="icon"></image>
				</u-cell-item>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				finance: {}
			};
		},
		onShow() {
			this.getData();
		},
		methods: {
			getData() {
				this.$u.get('/finance/balance').then(res => {
					this.finance = res.data.result.finance
				})
			}
		}
	}
</script>

<style lang="scss">
.u-cell {
	margin-top: 16rpx;
	padding: 28rpx 32rpx;
}
.top {
	background: url(../../static/images/jifen-bg.png);
	background-size: 100% 100%;
	width: 750rpx;
	height: 400rpx;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	
	.main {
		color: #fff;
		letter-spacing: 2rpx;
		min-height: 250rpx;
		.text {
			font-size: 28rpx;
			font-family: PingFangSC-Regular,PingFang SC;
			font-weight: 400;
		}
		.money {
			font-size: 80rpx;
			font-family: PingFangSC-Medium,PingFang SC;
			font-weight: 500;
		}
		.btn {
			width: 170rpx;
			height: 50rpx;
			border-radius: 26rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			&.btn1 {
				border: 1px solid #fff;
			}
			&.btn2 {
				background: #fff;
				color: #67BAF0;
			}
			&.on {
				transform: translate(1px, 1px);
			}
		}
	}
}
</style>
